<template>
    <u-popup mode="center" ref="wx_pop" :mask-close-able='flag'>
        <view class="mian">
            <view class="header">
                <view class="title"> 温馨提示 </view>
                <view class="info">
                    小程序暂不支持抽赏模式，请复制链接至浏览器下载APP后进行抽赏开箱。
                </view>
            </view>
            <view class="text">
                <view class="box" @click="copyAndroid">
                    <view class="left"> 安卓端：</view>
                    <view class="btn"> 点击即可复制 </view>
                </view>
                <view class="box" @click="copyIos">
                    <view class=" left"> IOS端：</view>
                    <view class="btn"> 点击即可复制 </view>
                </view>
                <view class="footer" @click="handleGoTo"> 如有问题可<text>“联系客服”</text>进行解决。</view>
            </view>
        </view>
    </u-popup>
</template>
	
<script>
export default {
    data() {
        return {
            adnroid: '',
            ios: "",
        }
    },
    created() {
        this.getUrl()
    },
    mounted() {
        this.$refs.wx_pop.open()
    },
    methods: {
        handleGoTo() {
            uni.navigateTo({
                url: "/orderPage/index/webkefuview"
            })
        },
        copyAndroid() {
            uni.setClipboardData({
                data: this.adnroid,
                success: res => {
                    this.$u.toast(' 复制成功！')
                }
            });
        },
        copyIos() {
            uni.setClipboardData({
                data: this.ios, success: res => {
                    this.$u.toast('复制成功！')
                }
            });
        },
        async getUrl() {
            const { data } = await this.$Request.get(this.$api.user.phoneType)
            this.adnroid = data.android_app_link
            this.ios = data.ios_app_link

        },

    }
}
</script>

<style lang="scss" scoped>
.mian {
    width: 536rpx;
    height: 550rpx;
    background: #fff;
    border-radius: 10rpx;

    .header {
        width: 536rpx;
        height: 248rpx;
        background-image: linear-gradient(rgba(79, 113, 225, 0.2), rgba(255, 255, 255, 0.2));
        border-radius: 10rpx;
        padding-top: 49rpx;

        .title {
            font-size: 30rpx;
            font-family: PingFang SC;
            font-weight: bold;
            color: #000000;
            text-align: center;
        }

        .info {
            width: 450rpx;
            text-align: left;
            margin: 0 auto;
            margin-top: 53rpx;
            font-size: 22rpx;
            font-family: PingFang SC;
            font-weight: 500;
            color: #000000;
        }

    }

    .text {
        .box {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-top: 31rpx;

            .left {
                font-size: 24rpx;
                font-family: PingFang SC;
                font-weight: 500;
                color: #000000;
            }

            .btn {
                font-size: 24rpx;
                font-family: PingFang SC;
                font-weight: bold;
                color: #FFFFFF;
                width: 226rpx;
                height: 60rpx;
                background: #485CBC;
                border-radius: 30rpx;
                text-align: center;
                line-height: 60rpx;
            }
        }
    }

    .footer {
        margin-top: 60rpx;
        font-size: 22rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #000000;
        text-align: center;

        text {
            color: #485CBC;
        }
    }
}
</style>
